package com.himiotech.core.project.data.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.himiotech.core.framework.helper.anno.MybatisMapper;
import com.himiotech.core.project.model.entity.online.UserOnline;
import org.apache.ibatis.annotations.Insert;

/**
 * 在线用户 数据层
 *
 * @author ruoyi
 * @author wuwenbin
 */
@MybatisMapper
public interface UserOnlineMapper extends BaseMapper<UserOnline> {

    /**
     * 保存会话信息
     *
     * @param online 会话信息
     */
    @Insert("replace into sys_user_online(session_id, login_name, dept_name, ip_addr, login_location, browser, os, status, start_timestamp, last_access_time, expire_time) " +
            "values (#{sessionId}, #{loginName}, #{deptName}, #{ipAddr}, #{loginLocation}, #{browser}, #{os}, #{status}, #{startTimestamp}, #{lastAccessTime}, #{expireTime})")
    void saveOnline(UserOnline online);
}
